package net.uhuijia.goods.goodspu.clientservice;


import net.uhuijia.goods.goodsku.persistence.model.GoodSku;
import net.uhuijia.goods.goodspu.persistence.model.GoodSpu;
import net.uhuijia.user.usermall.clientservice.UserMallClientServiceFallbackFactory;
import net.uhuijia.vo.good.GoodZBListVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "UHUIJIA-GOODS-PROVIDER-8001",fallbackFactory=GoodSpuClientServiceFallbackFactory.class)
public interface GoodSpuClientService {
    /**
     * @Author xzj
     * @Description //通过spuId查询商品信息
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    @RequestMapping(value = "/client/goodSpu/getGoodSpu/{spuId}")
    GoodSpu getGoodSpuBySpuId(@PathVariable("spuId")String spuId);

    /**
     * 将GoodSpu 转换成GoodZBListVo
     * @param spuId
     * @return
     */
    @RequestMapping(value = "/client/goodSpu/wrapToGoodZBListVo/{spuId}")
    GoodZBListVo goodSpuWrapToGoodZBListVo(@PathVariable("spuId")String spuId);


    /**
     * @Author xzj
     * @Description //获取商品库存
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    @RequestMapping(value = "/client/goodSpu/skuInvertory")
    Integer getGoodSkuInvertory(@RequestParam("spuId") String spuId, @RequestParam("groupPropertyId")String groupPropertyId);

    /**
     * @Author xzj
     * @Description // 检查商品规格库存是否足够
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    @RequestMapping(value = "/client/goodSpu/checkSkuInvertory")
    Boolean checkGoodSkuInvertoryIsEnough(@RequestParam("spuId")String spuId, @RequestParam("groupPropertyId")String groupPropertyId,@RequestParam("count")Integer count);

    /**
     * @Author xzj
     * @Description //根据spuId 和匹配值 查询goodSku
     * @Date  2018/10/8
     * @Param
     * @return
     **/
    @RequestMapping(value = "/client/goodSpu/getGoodSkuBySpuIdAndPropertyId")
    GoodSku getGoodSkuBySpuIdAndPropertyId(@RequestParam("spuId") String spuId, @RequestParam("groupPropertyId")String groupPropertyId);
    /**
     * @Author xzj
     * @Description //根据goodSkuId查询商品规格
     * @Date  2018/10/8
     * @Param 
     * @return 
     **/
    @RequestMapping(value = "/client/goodSpu/getGoodSkuByGoodSkuId")
    GoodSku getGoodSkuByGoodSkuId(@RequestParam("goodSkuId") String goodSkuId);
}
